package org.taj.adapter.llama;

import com.alibaba.fastjson2.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

public class LLaMAResponse {
    public static class Delta {
        @JSONField(name = "content")
        private String content;

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }
    }

    public static class Choice {
        @JSONField(name = "finish_reason")
        private String finishReason;
        @JSONField(name = "index")
        private long index;
        @JSONField(name = "delta")
        private Delta delta;

        public String getFinishReason() {
            return finishReason;
        }

        public void setFinishReason(String finishReason) {
            this.finishReason = finishReason;
        }

        public long getIndex() {
            return index;
        }

        public void setIndex(long index) {
            this.index = index;
        }

        public Delta getDelta() {
            return delta;
        }

        public void setDelta(Delta delta) {
            this.delta = delta;
        }
    }

    public static class Usage {
        @JSONField(name = "completion_tokens")
        private long completionTokens;
        @JSONField(name = "prompt_tokens")
        private long promptTokens;
        @JSONField(name = "total_tokens")
        private long totalTokens;

        public long getCompletionTokens() {
            return completionTokens;
        }

        public void setCompletionTokens(long completionTokens) {
            this.completionTokens = completionTokens;
        }

        public long getPromptTokens() {
            return promptTokens;
        }

        public void setPromptTokens(long promptTokens) {
            this.promptTokens = promptTokens;
        }

        public long getTotalTokens() {
            return totalTokens;
        }

        public void setTotalTokens(long totalTokens) {
            this.totalTokens = totalTokens;
        }
    }

    public static class Timing {
        @JSONField(name = "prompt_n")
        private long promptN;
        @JSONField(name = "prompt_ms")
        private double promptMs;
        @JSONField(name = "prompt_per_token_ms")
        private double promptPerTokenMs;
        @JSONField(name = "prompt_per_second")
        private double promptPerSecond;
        @JSONField(name = "predicted_n")
        private long predictedN;
        @JSONField(name = "predicted_ms")
        private double predictedMs;
        @JSONField(name = "predicted_per_token_ms")
        private double predictedPreTokenMs;
        @JSONField(name = "predicted_per_second")
        private double predictedPreSecond;

        public long getPromptN() {
            return promptN;
        }

        public void setPromptN(long promptN) {
            this.promptN = promptN;
        }

        public double getPromptMs() {
            return promptMs;
        }

        public void setPromptMs(double promptMs) {
            this.promptMs = promptMs;
        }

        public double getPromptPerTokenMs() {
            return promptPerTokenMs;
        }

        public void setPromptPerTokenMs(double promptPerTokenMs) {
            this.promptPerTokenMs = promptPerTokenMs;
        }

        public double getPromptPerSecond() {
            return promptPerSecond;
        }

        public void setPromptPerSecond(double promptPerSecond) {
            this.promptPerSecond = promptPerSecond;
        }

        public long getPredictedN() {
            return predictedN;
        }

        public void setPredictedN(long predictedN) {
            this.predictedN = predictedN;
        }

        public double getPredictedMs() {
            return predictedMs;
        }

        public void setPredictedMs(double predictedMs) {
            this.predictedMs = predictedMs;
        }

        public double getPredictedPreTokenMs() {
            return predictedPreTokenMs;
        }

        public void setPredictedPreTokenMs(double predictedPreTokenMs) {
            this.predictedPreTokenMs = predictedPreTokenMs;
        }

        public double getPredictedPreSecond() {
            return predictedPreSecond;
        }

        public void setPredictedPreSecond(double predictedPreSecond) {
            this.predictedPreSecond = predictedPreSecond;
        }
    }

    @JSONField(name = "choices")
    private List<Choice> choices = new ArrayList<>();
    @JSONField(name = "created")
    private long created;
    @JSONField(name = "id")
    private String id;
    @JSONField(name = "model")
    private String model;
    @JSONField(name = "system_fingerprint")
    private String systemFingerprint;
    @JSONField(name = "object")
    private String object;
    @JSONField(name = "usage")
    private Usage usage;
    @JSONField(name = "timings")
    private Timing timings;

    public List<Choice> getChoices() {
        return choices;
    }

    public void setChoices(List<Choice> choices) {
        this.choices = choices;
    }

    public long getCreated() {
        return created;
    }

    public void setCreated(long created) {
        this.created = created;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getSystemFingerprint() {
        return systemFingerprint;
    }

    public void setSystemFingerprint(String systemFingerprint) {
        this.systemFingerprint = systemFingerprint;
    }

    public String getObject() {
        return object;
    }

    public void setObject(String object) {
        this.object = object;
    }

    public Usage getUsage() {
        return usage;
    }

    public void setUsage(Usage usage) {
        this.usage = usage;
    }

    public Timing getTimings() {
        return timings;
    }

    public void setTimings(Timing timings) {
        this.timings = timings;
    }
}
